package org.logic.fuzzysets.summarizers.workinghours;

import org.dataSource.DataBaseInfo;
import org.logic.fuzzysets.AFuzzySet;
import org.logic.membershipFunctions.TriangularFunction;

public class HardworkingFuzzySet extends AFuzzySet{

	public HardworkingFuzzySet(DataBaseInfo db) {

		double middleFactor = 1.0;

		setMembershipFunction(new TriangularFunction(db.getMinWokingHours(),db.getMaxWorkingHours(),middleFactor));
		setUniverse(db.getAllWorkingHours());
	}

	public HardworkingFuzzySet(DataBaseInfo db,String subject) {

		db.setOnlyRecords(subject);
		setSubject(subject);
		double middleFactor = 1.0;

		setMembershipFunction(new TriangularFunction(db.getMinWokingHours(),db.getMaxWorkingHours(),middleFactor));
		setUniverse(db.getAllWorkingHours());
	}


	@Override
	public String getLabel() {
		AFuzzySet qualifier = getQualifier();
		if(qualifier != null && getSubject()==null)
		return " who "+qualifier.getLabel()+" are hard-working";
		else
		return " are hard working";
	}

}
